﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;

namespace UnitOfWorkTest.Mocks
{
    public class MockDbInitializer : DropCreateDatabaseAlways<MockDbContext>
    {
        protected override void Seed(MockDbContext context)
        {
            base.Seed(context);

            context.Employer.Add(new Employer
            {
                Name = "TestName",
                Surname = "TestSurname",
                Employees = new List<Employee>() { 
                    new Employee { Name = "Employee1", Surname = "E1", Rank = 8, Salary = 3450 },
                    new Employee { Name = "Employee2", Surname = "E2", Rank = 6, Salary = 2450 }
                }
            });

            context.SaveChanges();

            context.Employees.Add(new Employee { Name = "Employee2", Surname = "TestName", Rank = 5, Salary = 2450 });

            context.SaveChanges();
        }
    }
}
